const mongoose=require("mongoose")
let Schema=mongoose.Schema

mongoose.connect("mongodb://127.0.0.1:27017/feiji",{
    useNewUrlParser:true,
    useUnifiedTopology:true
}).then(()=>{
    console.log("数据库连接成功")
})

let singerDetail=new Schema({
    singer_name: {
        type:String,
        required:true
    },
    singer_mid: {
        type:String,
        required:true
    },
    singer_id: {
        type:Number,
        required:true
    },
    songList: [
        {
            songName:{
                type:String,
                require:true
            },
            songMid:{
                type:String,
            },
            songAlbum:{
                type:String,
            }
        }
    ],
    songTotalNumber:{
        type:Number,
        default:0
    },
    fansTotalNumber:{
        type:Number,
        required:true
    }
})

let singerDetailTable=mongoose.model("singerDetailTable",singerDetail)

module.exports={
    singerDetailTable
}

